package com.giscloud.limp.entity;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.ArrayList;
import java.util.Arrays;
/**
 * 案件执行信息
 * 
 * @author giscloud
 * @email giscloud@giscloud.com
 * @date 2020-07-07 10:45:08
 */
@Data
public class CaseExecution implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 案件执行ID
	 */
   private Integer caseExecutionId;
	/**
	 * 案件ID
	 */
   private Integer caseId;
	/**
	 * 执行案件号
	 */
   private String executionCaseCode;
	/**
	 * 诉讼类型 1|主诉;2|被诉
	 */
   private Integer litigationType;
	/**
	 * 案由
	 */
   private Integer actionCause;
	/**
	 * 执行受理时间
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date executionDate;
	/**
	 * 申请执行人
	 */
   private String executor;
	/**
	 * 被执行人
	 */
   private String executee;
	/**
	 * 诉讼标的额
	 */
   private BigDecimal litigationAmount;
	/**
	 * 诉讼请求
	 */
   private String litigationClaim;
	/**
	 * 执行受理法院
	 */
   private String acceptanceCourt;
	/**
	 * 受理法院类型
	 */
   private String courtType;
	/**
	 * 办案人
	 */
   private String caseHandler;
	/**
	 * 办案人联系方式
	 */
   private String caseHandlerTel;
	/**
	 * 案件处理意见
	 */
   private String caseHandlingOpinions;
	/**
	 * 执行附件
	 */
   private String attachmentId;
	/**
	 * 执行附件收到时间
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date attachmentReceiveDate;
	/**
	 * 其它附件
	 */
   private String otherAttachmentId;
	/**
	 * 状态
	 */
   private Integer statusCd;
	/**
	 * 创建人ID
	 */
   private Integer createdStaffId;
	/**
	 * 创建时间
	 */
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date createdDt;
	/**
	 * 修改人
	 */
   private Integer operateStaffId;
	/**
	 * 修改时间
	 */
   private Date version;
	/**
	 * 执行措施 1|冻结账户;2|查封财产;3|扣押财产;4|行为执行
	 */
   private Integer executionMeasure;
	/**
	 * 执行情况说明
	 */
   private String executionInfo;

	/**
	 * 提醒日期
	 */
	private Date warnDate;
	/**
	 * 提醒内容
	 */
	private String warnContent;

public enum Column {
						caseExecutionId("case_execution_id","caseExecutionId","INTEGER",false),
								caseId("case_id","caseId","INTEGER",false),
								executionCaseCode("execution_case_code","executionCaseCode","VARCHAR",false),
								litigationType("litigation_type","litigationType","INTEGER",false),
								actionCause("action_cause","actionCause","INTEGER",false),
								executionDate("execution_date","executionDate","DATE",false),
								executor("executor","executor","VARCHAR",false),
								executee("executee","executee","VARCHAR",false),
								litigationAmount("litigation_amount","litigationAmount","NUMERIC",false),
								litigationClaim("litigation_claim","litigationClaim","VARCHAR",false),
								acceptanceCourt("acceptance_court","acceptanceCourt","VARCHAR",false),
								courtType("court_type","courtType","VARCHAR",false),
								caseHandler("case_handler","caseHandler","VARCHAR",false),
								caseHandlerTel("case_handler_tel","caseHandlerTel","VARCHAR",false),
								caseHandlingOpinions("case_handling_opinions","caseHandlingOpinions","VARCHAR",false),
								attachmentId("attachment_id","attachmentId","VARCHAR",false),
								attachmentReceiveDate("attachment_receive_date","attachmentReceiveDate","DATE",false),
								otherAttachmentId("other_attachment_id","otherAttachmentId","VARCHAR",false),
								statusCd("status_cd","statusCd","INTEGER",false),
								createdStaffId("created_staff_id","createdStaffId","INTEGER",false),
								createdDt("created_dt","createdDt","TIMESTAMP",false),
								operateStaffId("operate_staff_id","operateStaffId","INTEGER",false),
								version("version","version","TIMESTAMP",false),
								executionMeasure("execution_measure","executionMeasure","INTEGER",false),
								executionInfo("execution_info","executionInfo","VARCHAR",false);
	    		private static final String BEGINNING_DELIMITER = "`";
	private static final String ENDING_DELIMITER = "`";
	private final String column;
	private final boolean isColumnNameDelimited;
	private final String javaProperty;
	private final String jdbcType;
	public String value() {
		return this.column;
	}
	public String getValue() {
		return this.column;
	}
	public String getJavaProperty() {
		return this.javaProperty;
	}
	public String getJdbcType() {
		return this.jdbcType;
	}
	Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
		this.column = column;
		this.javaProperty = javaProperty;
		this.jdbcType = jdbcType;
		this.isColumnNameDelimited = isColumnNameDelimited;
	}
	public String desc() {
		return this.getEscapedColumnName() + " DESC";
	}
	public String asc() {
		return this.getEscapedColumnName() + " ASC";
	}
	public static Column[] excludes(Column ... excludes) {
		ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
		if (excludes != null && excludes.length > 0) {
			columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
		}
		return columns.toArray(new Column[]{});
	}
	public String getEscapedColumnName() {
		if (this.isColumnNameDelimited) {
			return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
		} else {
			return this.column;
		}
	}
	public String getAliasedEscapedColumnName() {
		return this.getEscapedColumnName();
	}
  }

}
